package com.campus.backend.controller;

import com.campus.backend.bean.pointsrecord.PointsRecordQueryParam;
import com.campus.backend.service.PointsRecordService;
import com.campus.backend.vo.pointsrecord.PointsRecordVo;
import com.campus.common.bean.common.Pagination;
import com.campus.common.bean.common.Resp;
import com.github.pagehelper.PageInfo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 积分记录表 前端控制器
 * </p>
 *
 * @author ZhaoYuJie
 * @since 2025-05-21
 */
@Api(tags = "积分记录管理")
@RestController
@RequestMapping("/points-record")
public class PointsRecordController {

    @Autowired
    private PointsRecordService pointsRecordService;

    /**
     * 分页查询积分记录列表
     *
     * @param param 查询参数
     * @return 分页结果
     */
    @ApiOperation("分页查询积分记录列表")
    @GetMapping("/page")
    public Resp<Pagination<PointsRecordVo>> page(@Validated PointsRecordQueryParam param) {
        PageInfo<PointsRecordVo> pageInfo = pointsRecordService.getPointsRecordListPage(param);
        return Resp.successPageable(pageInfo);
    }
}
